<!doctype html>
<html lang="zh-cn">

<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Question</title>
  <link rel="stylesheet" href="./github.min.css">
  <script src="./highlight.min.js"></script>
  <style>
    body {
      font-size: 14px;
      line-height: 1.6;
      margin: 0;
      padding: 16px;
    }

    img {
      max-width: 100%;
    }

    pre code {
      background-color: #f5f5f5 !important;
      border-radius: 8px;
    }
  </style>
</head>

<body>

  <div id="content"></div>
  <button>返回上一页-弹个提示</button>

  <script>
    // h5侧准备好回调函数
    function writeHtml(str) {
      const el = document.querySelector('#content');
      el.innerHTML = str;
      hljs.highlightAll();
    }

    const btn = document.querySelector('button')
    btn.onclick = function() {
      // 调用注入过来的对象, 传递参数
      window.obj.test('我是h5端的参数')
    }
  </script>
</body>

</html>